﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gunningine
{

    internal class EntityState
    {
        public string Name { get; private set; }

        public Action<WorldState> OnUpdate { get; private set; }

        public Action<object[]> OnEnter { get; private set; }

        public Action OnExit { get; private set; }

        public Action<Entity[]> OnSee { get; private set; }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        public EntityState(string name)
        {
            this.OnUpdate = null;
            this.OnEnter = null;
            this.OnExit = null;
            this.OnSee = null;
        }

        /// <summary>
        /// Set enter function.
        /// </summary>
        /// <param name="enterFunc"></param>
        public void SetEnterFunction(Action<object[]> enterFunc)
        {
            this.OnEnter = enterFunc;
        }

        /// <summary>
        /// Set exit function.
        /// </summary>
        /// <param name="exitFunc"></param>
        public void SetExitFunction(Action exitFunc)
        {
            this.OnExit = exitFunc;
        }

        /// <summary>
        /// Set update function.
        /// </summary>
        /// <param name="exitFunc"></param>
        public void SetUpdateFunction(Action<WorldState> updateFunc)
        {
            this.OnUpdate = updateFunc;
        }

        /// <summary>
        /// Set on-see function.
        /// </summary>
        /// <param name="exitFunc"></param>
        public void SetOnSeeFunction(Action<Entity[]> onSeeFunc)
        {
            this.OnSee = onSeeFunc;
        }
    }
}
